home *** CD-ROM | disk | FTP | other *** search
/ Technotools / Technotools (Chestnut CD-ROM)(1993).ISO / lang_c / mscheap2 / pack.c < prev    next >
C/C++ Source or Header  |  1990-03-07  |  561b  |  35 lines

  1.         #include <stdio.h>
  2.  
  3.         #include <heap.h>
  4.  
  5.         //
  6.         //  Example of _heappack from heap.man
  7.         //
  8.  
  9.         int main()
  10.         {
  11.         void far *p1 = _fmalloc( 1000 );
  12.  
  13.         void far *p2 = _fmalloc( 2000 );
  14.  
  15.         void far *p3 = _fmalloc( 3000 );
  16.  
  17.         _ffree( p2 );
  18.  
  19.         _ffree( p3 );
  20.  
  21.         printf("Before packing\n\n");
  22.  
  23.         _fheapdump( stdout, 1 );
  24.  
  25.         _fheappack();
  26.  
  27.         printf("After packing\n\n");
  28.  
  29.         _fheapdump( stdout, 1 );
  30.  
  31.         return( 0 );
  32.         }
  33.  
  34.  
  35.